package com.trestristesmicos.anahuac;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ProspectoAdapter  extends BaseAdapter {
	private Context context;
	private List<Prospecto> listProspectos;
	
	
	public ProspectoAdapter(Context context, List<Prospecto> listProspectos) {
        this.context = context;
        this.listProspectos = listProspectos;
    }
	
	public int getCount() {
		 return listProspectos.size();
	}

	public Object getItem(int position) {
		return listProspectos.get(position);
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		Prospecto prospecto = listProspectos.get(position);
        if (convertView == null) {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = inflater.inflate(R.layout.prospectos_row, null);
        }
        
        TextView tvContact = (TextView) convertView.findViewById(R.id.row_nombre);
        tvContact.setText(prospecto.getNombre());

        TextView tvPhone = (TextView) convertView.findViewById(R.id.row_correo);
        tvPhone.setText(prospecto.getEmail());

        TextView tvMail = (TextView) convertView.findViewById(R.id.row_licenciatura);
        tvMail.setText(prospecto.getLicenciatura());

        return convertView;
	}
}




    


